VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form frmWrite 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form1"
   ClientHeight    =   2160
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4035
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2160
   ScaleWidth      =   4035
   StartUpPosition =   1  'CenterOwner
   Begin ComctlLib.ProgressBar pgBlocks 
      Height          =   300
      Left            =   210
      TabIndex        =   3
      Top             =   945
      Width           =   3630
      _ExtentX        =   6403
      _ExtentY        =   529
      _Version        =   327682
      Appearance      =   1
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "&OK"
      Height          =   375
      Left            =   600
      TabIndex        =   1
      Top             =   1440
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      Height          =   375
      Left            =   2280
      TabIndex        =   0
      Top             =   1440
      Width           =   1215
   End
   Begin VB.Label lblEvents 
      Height          =   375
      Left            =   600
      TabIndex        =   2
      Top             =   360
      Width           =   3015
   End
End
Attribute VB_Name = "frmWrite"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'******************************************************************
'* File name     : frmMain.frm
'* Version       : 0.2.0
'* Last revision : 15/01/05
'* Purpose       : Handles writing session
'*******************************************************************

'Copyright (C) 2004  Michele Moccia

'This program is free software; you can redistribute it and/or modify
'it under the terms of the GNU General Public License as published by
'the Free Software Foundation; either version 2 of the License, or
'(at your option) any later version.
'
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'GNU General Public License for more details.
'
'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


Option Explicit

Private WithEvents mx As MxCtl
Attribute mx.VB_VarHelpID = -1
Private sFileName As String

Private Sub cmdCancel_Click()

    mx.CancelWrite

End Sub

Private Sub cmdOk_Click()

    Unload Me
    
End Sub

Private Sub Form_Activate()

    mx.WriteISOImage sFileName

End Sub

Private Sub Form_Load()

    Me.Caption = App.Title & " - Write iso file"
    cmdOk.Enabled = False

End Sub

Private Sub mx_BeginWrite()

    lblEvents.Caption = "Begin to write CD..."

End Sub

Private Sub mx_BlocksWritten(ByVal BlockNum As Long, ByVal TotalBlocks As Long)

    lblEvents.Caption = "Writes block n." & CStr(BlockNum) & _
                        " of " & CStr(TotalBlocks)
                        
    pgBlocks.Value = CSng(BlockNum / TotalBlocks) * 100

End Sub

Private Sub mx_ClosingSession()

    cmdCancel.Enabled = False
    lblEvents.Caption = "Closing session..."

End Sub

Private Sub mx_EndWrite()

    lblEvents.Caption = "Write end"

End Sub

Private Sub mx_WriteCancelled()

    MsgBox "Current write operation aborted", , App.Title
    Unload Me

End Sub

Private Sub mx_WriteComplete()

    lblEvents.Caption = "Write complete..."
    cmdOk.Enabled = True

End Sub

Private Sub mx_LogicalError(ByVal ErrorId As MoxCdBurnLibCtl.eLogicalErr, ByVal ErrorString As String)
    
    Unload Me

End Sub

Private Sub mx_SysError(ByVal ErrorId As Long, ByVal ErrorString As String)

    Unload Me
    
End Sub

Private Sub mx_CdrError(ByVal ErrorId As MoxCdBurnLibCtl.eCdrErr, ByVal ErrorString As String)

    Unload Me

End Sub


Public Property Let MxControl(ByRef vNewValue As MxCtl)

    Set mx = vNewValue

End Property

Public Property Let FileName(ByVal vNewValue As String)

    sFileName = vNewValue

End Property



